package edu.sias.controller;


import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import java.io.IOException;



@WebServlet(urlPatterns = "/user/info")

public class UserInfoServlet extends HttpServlet {



    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //判断下是否有用户登录

        Object o = request.getSession()

                .getAttribute("status");

        if (null != o){

            //已登录状态

            response.sendRedirect("/userInfo.jsp");

        }else {

            //未登录

            response.sendRedirect("/login.jsp");
        }







    }

}
